package com.my.socket.nio.v6;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.InetSocketAddress;
import java.nio.channels.ServerSocketChannel;

public class Server {
    private static final Logger LOGGER = LoggerFactory.getLogger(Server.class);

    public static void main(String[] args) throws Exception {
        ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
        serverSocketChannel.configureBlocking(false);
        InetSocketAddress inetSocketAddress = new InetSocketAddress(9999);
        serverSocketChannel.bind(inetSocketAddress);

        for (int i = 0; i < 1; i++) {
            new Thread(new SelectorTask(serverSocketChannel), "selector-" + i).start();
        }
    }
}
